<?php

require_once("../../controllers/init.php");
require_once($FILE_SYSTEM_ROOT."/controllers/authentication.php");
require_once($FILE_SYSTEM_ROOT."/model/classes/events/SNAPEvent.php");

//echo $GLOBALS['SESSION_ID'];

if(!$GLOBALS['IS_LOGGED_ON'])
{
	echo "ERROR_NOT_LOGGED_ON";
	exit;
}

$UserID=$_POST['UserID'];
$user = new User($UserID);




$groups = $GLOBALS['USERGROUPS'];				

$userArr = array('UserID'=>$user->getUserID(),
				'LongName'=>$user->getLongName(),
				'ShortName'=>$user->getShortName(),
				'Password'=>$user->getPassword(),
				'Email'=>$user->getEmail(),
				'GroupID'=>$user->getGroupID(),
				'Group'=>$groups[$user->getGroupID()]
				);

//print_r($userArr);

$userData = json_encode($userArr);
echo $userData;
